package myspring.clazz;

import java.lang.reflect.Constructor;
import java.lang.reflect.InvocationTargetException;

class Test {

    private Test() {
        
    }
    /**
     * @param args
     */
    public static void main(String[] args) {
        try {
            Constructor ctor =Person.class.getDeclaredConstructor();
            Class clazz = ctor.getDeclaringClass();
            System.out.println(clazz);
            int modifier = ctor.getDeclaringClass().getModifiers();
            System.out.println("getDeclaringClass modifier: " + modifier);
            modifier = ctor.getModifiers();
            System.out.println("modifier: " + modifier);
            ctor.setAccessible(true);
            Person p = Person.class.cast(ctor.newInstance());
        } catch (SecurityException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        } catch (NoSuchMethodException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        } catch (IllegalArgumentException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        } catch (InstantiationException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        } catch (IllegalAccessException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        } catch (InvocationTargetException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
    }

}
